﻿using System;
using System.Collections.Generic;

namespace MvcForum.Net.Bussiness
{
  public class SubscriptionRepo
    {
      public static List<Subscription> List(int userId,short type,int pageIndex,int pageSize, out int totalRows)
      {
          var _sp = MainDB.Instant.Subscription_List(userId, type, pageIndex, pageSize);

         var _data= _sp.ExecuteTypedList<Subscription>();

          totalRows = Convert.ToInt32(_sp.OutputParameters.GetParameter("TotalRows").ParameterValue);

          return _data;

      }


      public static void Save(int Id, int userId,int forumId,int topicId,short notificationType)
      {
          MainDB.Instant.Subscription_Save(Id,forumId,topicId,userId,notificationType).Execute();
      }
    }
}
